import request from '@/utils/request'

//获取用户信息
export const businessInfoService = () => {
    return request.get('/Business/businessInfo');
}

//更新用户信息
export const businessInfoUpdateService = (businessInfo: any) => {
    return request.post('/Business/update',businessInfo);
}

//更新用户密码
export const businessPasswordUpdateService = (params: Map<string, string>) => {
    const paramsObject = Object.fromEntries(params);
    return request.post('/Business/updatePassword',paramsObject);
}

//获取该商家上架的全部商品
export const getAllGoods = () => {
    return request.get('/Business/getAllGoods');
}

//更新用户头像
export const businessAvatarUpdateService = (imageURL: string) => {
    const data = { file: imageURL };
    return request.post('/Business/updateImage', data);
}

//获取顾客浏览商品记录
export const getAllBrowsingHistoryService = (params: any) => {
    return request.get('/browsingHistory/getBrowsingHistory', {params: params});
}

//删除顾客浏览商品记录
export const deleteBrowsingHistoryService = (params: any) => {
    return request.post('/browsingHistory/deleteBrowsingHistory', params);
}